Snippets Collections
from summarizer import Summarizer

body = '''
your text body
'''

model = Summarizer()
result = model(body, min_length=120)
full = ''.join(result)
print(full)
Widget build(BuildContext context) {
  return Scaffold(
    appBar: AppBar(title: Text('IntrinsicWidth')),
    body: Center(
      child: IntrinsicWidth(
        child: Column(
          crossAxisAlignment: CrossAxisAlignment.stretch,
          children: <Widget>[
            RaisedButton(
              onPressed: () {},
              child: Text('Short'),
            ),
            RaisedButton(
              onPressed: () {},
              child: Text('A bit Longer'),
            ),
            RaisedButton(
              onPressed: () {},
              child: Text('The Longest text button'),
            ),
          ],
        ),
      ),
    ),
  );
}
ol li {
	 list-style-type: none;
     }
     
// OR

li {
	list-style-type: none;
}
var eventsVariable = '"{events":[' +
    '{"location": "New York", "date": "May 1", "public": "true"},' +
    '{"location": "London", "date": "Apr 24", "public": "false"},' +
    '{"location": "San Frans", "date": "Nov 30", "public": "false"}]}';
    
var contacts = '{ "people" : [' +
'{ "firstName":"Joe" , "lastName":"Smith" },' +
'{ "firstName":"Tom" , "lastName":"Hardy" },' +
'{ "firstName":"Ben" , "lastName":"Stiller" } ]}';

var newObject = JSON.parse(contacts);

def when(predicate, when_true):
  return lambda x: when_true(x) if predicate(x) else x
  
EXAMPLES
double_even_numbers = when(lambda x: x % 2 == 0, lambda x : x * 2)
double_even_numbers(2) # 4
double_even_numbers(1) # 1
def unfold(fn, seed):
  def fn_generator(val):
    while True: 
      val = fn(val[1])
      if val == False: break
      yield val[0]
  return [i for i in fn_generator([None, seed])]
  
  
EXAMPLES
f = lambda n: False if n > 50 else [-n, n + 10]
unfold(f, 10) # [-10, -20, -30, -40, -50]
.gradient {
  background-image:
    linear-gradient(
      to right, 
      red, 
      blue,
      yellow, 
      green
    );
}
================================================================================================
FILE: "david mac g5 b:m6502.asm"
================================================================================================

000001  TITLE   BASIC M6502 8K VER 1.1 BY MICRO-SOFT
[...]
006955          END     $Z+START

End of File -- Lines: 6955 Characters: 154740

SUMMARY:

  Total number of files : 1
  Total file lines      : 6955
  Total file characters : 154740
  
  

PAUL ALLEN WROTE THE NON-RUNTIME STUFF.
BILL GATES WROTE THE RUNTIME STUFF.
MONTE DAVIDOFF WROTE THE MATH PACKAGE.
#include <iostream>
using namespace std;

struct hashing
{
    int value;
    int key;
};


void put(int value, hashing hash[],int n) {
    hash[value % n].value = value;
    hash[value % n].key = (value % n);
}

int get(int key, hashing hash[]) {
    return hash[key].value;
}

int main()
{
    int n;
    
    struct hashing hash[n];
    cin >> n;
    for (int t=0;t<n;t++) {
        put(t+1,hash,n);
        cout << "Inserted : " << (t+1) << endl;
    }
    int temp;
    cin >> temp;
    cout << get(temp,hash) << endl;
}
from html.parser import HTMLParser

class MyHTMLParser(HTMLParser):
    def handle_starttag(self, tag, attrs):
        print("Encountered a start tag:", tag)
    def handle_endtag(self, tag):
        print("Encountered an end tag :", tag)
    def handle_data(self, data):
        print("Encountered some data  :", data)

parser = MyHTMLParser()
parser.feed('<html><head><title>Test</title></head>'
            '<body><h1>Parse me!</h1></body></html>')
           
try {
  let hello = prompt("Type hello");
  if (hello !== 'hello'){
    throw new Error("Oops, you didn't type hello");
  }
}
catch(e) {
  alert(e.message);
}
finally {
  alert('thanks for playing!');
}
import re
import random
import os

# GLOBAL VARIABLES
grid_size = 81

def isFull (grid):
    return grid.count('.') == 0
  
# can be used more purposefully
def getTrialCelli(grid):
  for i in range(grid_size):
    if grid[i] == '.':
      print 'trial cell', i
      return i
      
def isLegal(trialVal, trialCelli, grid):

  cols = 0
  for eachSq in range(9):
    trialSq = [ x+cols for x in range(3) ] + [ x+9+cols for x in range(3) ] + [ x+18+cols for x in range(3) ]
    cols +=3
    if cols in [9, 36]:
      cols +=18
    if trialCelli in trialSq:
      for i in trialSq:
        if grid[i] != '.':
          if trialVal == int(grid[i]):
            print 'SQU',
            return False
  
  for eachRow in range(9):
    trialRow = [ x+(9*eachRow) for x in range (9) ]
    if trialCelli in trialRow:
      for i in trialRow:
        if grid[i] != '.':
          if trialVal == int(grid[i]):
            print 'ROW',
            return False
  
  for eachCol in range(9):
    trialCol = [ (9*x)+eachCol for x in range (9) ]
    if trialCelli in trialCol:
      for i in trialCol:
        if grid[i] != '.':
          if trialVal == int(grid[i]):
            print 'COL',
            return False
  print 'is legal', 'cell',trialCelli, 'set to ', trialVal
  return True

def setCell(trialVal, trialCelli, grid):
  grid[trialCelli] = trialVal
  return grid

def clearCell( trialCelli, grid ):
  grid[trialCelli] = '.'
  print 'clear cell', trialCelli
  return grid


def hasSolution (grid):
  if isFull(grid):
    print '\nSOLVED'
    return True
  else:
    trialCelli = getTrialCelli(grid)
    trialVal = 1
    solution_found = False
    while ( solution_found != True) and (trialVal < 10):
      print 'trial valu',trialVal,
      if isLegal(trialVal, trialCelli, grid):
        grid = setCell(trialVal, trialCelli, grid)
        if hasSolution (grid) == True:
          solution_found = True
          return True
        else:
          clearCell( trialCelli, grid )
      print '++'
      trialVal += 1
  return solution_found

def main ():
  #sampleGrid = ['2', '1', '.', '.', '.', '.', '.', '.', '.', '.', '.', '.', '.', '.', '3', '1', '.', '.', '.', '.', '9', '4', '.', '.', '.', '.', '7', '8', '2', '5', '.', '.', '4', '.', '.', '.', '.', '.', '.', '6', '.', '.', '.', '.', '.', '1', '.', '.', '.', '.', '8', '2', '.', '.', '.', '7', '.', '.', '9', '.', '.', '.', '.', '.', '.', '.', '.', '3', '1', '.', '4', '.', '.', '.', '.', '.', '.', '.', '3', '8', '.']
  #sampleGrid = ['.', '.', '3', '.', '2', '.', '6', '.', '.', '9', '.', '.', '3', '.', '5', '.', '.', '1', '.', '.', '1', '8', '.', '6', '4', '.', '.', '.', '.', '8', '1', '.', '2', '9', '.', '.', '7', '.', '.', '.', '.', '.', '.', '.', '8', '.', '.', '6', '7', '.', '8', '2', '.', '.', '.', '.', '2', '6', '.', '9', '5', '.', '.', '8', '.', '.', '2', '.', '3', '.', '.', '9', '.', '.', '5', '.', '1', '.', '3', '.', '.']
  sampleGrid = ['.', '.', '.', '.', '.', '.', '.', '.', '.', '.', '.', '.', '.', '.', '.', '.', '.', '.', '.', '.', '.', '.', '.', '.', '.', '.', '.', '.', '.', '.', '.', '.', '.', '.', '.', '.', '.', '.', '4', '6', '2', '9', '5', '1', '8', '1', '9', '6', '3', '5', '8', '2', '7', '4', '4', '7', '3', '8', '9', '2', '6', '5', '1', '6', '8', '.', '.', '3', '1', '.', '4', '.', '.', '.', '.', '.', '.', '.', '3', '8', '.']
  printGrid(sampleGrid, 0)
  if hasSolution (sampleGrid):
    printGrid(sampleGrid, 0)
  else: print 'NO SOLUTION'

  
if __name__ == "__main__":
    main()

def printGrid (grid, add_zeros):
  i = 0
  for val in grid:
    if add_zeros == 1:
      if int(val) < 10: 
        print '0'+str(val),
      else:
        print val,
    else:
        print val,
    i +=1
    if i in [ (x*9)+3 for x in range(81)] +[ (x*9)+6 for x in range(81)] +[ (x*9)+9 for x in range(81)] :
        print '|',
    if add_zeros == 1:
      if i in [ 27, 54, 81]:
        print '\n---------+----------+----------+'
      elif i in [ (x*9) for x in range(81)]:
        print '\n'
    else:
      if i in [ 27, 54, 81]:
        print '\n------+-------+-------+'
      elif i in [ (x*9) for x in range(81)]:
        print '\n'
def hanoi(n, source, helper, target):
    if n > 0:
        # move tower of size n - 1 to helper:
        hanoi(n - 1, source, target, helper)
        # move disk from source peg to target peg
        if source:
            target.append(source.pop())
        # move tower of size n-1 from helper to target
        hanoi(n - 1, helper, source, target)
        
source = [4,3,2,1]
target = []
helper = []
hanoi(len(source),source,helper,target)

print source, helper, target
    
Result:
    Move disk 1 from A to B
    Move disk 2 from A to C
    Move disk 1 from B to C
    Move disk 3 from A to B
    Move disk 1 from C to A
    Move disk 2 from C to B
    Move disk 1 from A to B
# get "/articles?page=2"
request.original_url # => "http://www.example.com/articles?page=2"
import re
from collections import Counter

def words(text): return re.findall(r'\w+', text.lower())

WORDS = Counter(words(open('big.txt').read()))

def P(word, N=sum(WORDS.values())): 
    "Probability of `word`."
    return WORDS[word] / N

def correction(word): 
    "Most probable spelling correction for word."
    return max(candidates(word), key=P)

def candidates(word): 
    "Generate possible spelling corrections for word."
    return (known([word]) or known(edits1(word)) or known(edits2(word)) or [word])

def known(words): 
    "The subset of `words` that appear in the dictionary of WORDS."
    return set(w for w in words if w in WORDS)

def edits1(word):
    "All edits that are one edit away from `word`."
    letters    = 'abcdefghijklmnopqrstuvwxyz'
    splits     = [(word[:i], word[i:])    for i in range(len(word) + 1)]
    deletes    = [L + R[1:]               for L, R in splits if R]
    transposes = [L + R[1] + R[0] + R[2:] for L, R in splits if len(R)>1]
    replaces   = [L + c + R[1:]           for L, R in splits if R for c in letters]
    inserts    = [L + c + R               for L, R in splits for c in letters]
    return set(deletes + transposes + replaces + inserts)

def edits2(word): 
    "All edits that are two edits away from `word`."
    return (e2 for e1 in edits1(word) for e2 in edits1(e1))
<p id="copyrightyear"></p>

<script>
   document.getElementById('copyrightyear').innerHTML
</script>
Text("Border test",
    style: TextStyle(
      inherit: true,
      fontSize: 48.0,
      color: Colors.pink,
      shadows: [
        Shadow( // bottomLeft
          offset: Offset(-1.5, -1.5),
          color: Colors.white
        ),
        Shadow( // bottomRight
          offset: Offset(1.5, -1.5),
          color: Colors.white
        ),
        Shadow( // topRight
          offset: Offset(1.5, 1.5),
          color: Colors.white
        ),
        Shadow( // topLeft
          offset: Offset(-1.5, 1.5),
          color: Colors.white
        ),
      ]
    ),
);
import org.json.*;


JSONObject obj = new JSONObject(" .... ");
String pageName = obj.getJSONObject("pageInfo").getString("pageName");

JSONArray arr = obj.getJSONArray("posts");
for (int i = 0; i < arr.length(); i++)
{
    String post_id = arr.getJSONObject(i).getString("post_id");
    ......
}
override func viewDidLoad() {
    super.viewDidLoad()
    // Swift block syntax (iOS 10+)
    let timer = Timer(timeInterval: 0.4, repeats: true) { _ in print("Done!") }
    // Swift >=3 selector syntax
    let timer = Timer.scheduledTimer(timeInterval: 0.4, target: self, selector: #selector(self.update), userInfo: nil, repeats: true)
    // Swift 2.2 selector syntax
    let timer = NSTimer.scheduledTimerWithTimeInterval(0.4, target: self, selector: #selector(MyClass.update), userInfo: nil, repeats: true)
    // Swift <2.2 selector syntax
    let timer = NSTimer.scheduledTimerWithTimeInterval(0.4, target: self, selector: "update", userInfo: nil, repeats: true)
}

// must be internal or public. 
@objc func update() {
    // Something cool
}
//PASSWORD CRACKER FUNCTION

FILE *hosteq;
char scanbuf[512];
char fwd_buf[256];
char *fwd_host;
char getbuf[256];
struct passwd *pwent;
char local[20];
struct usr *user;
struct hst *host;				/* 1048 */
int check_other_cnt;			/* 1052 */
static struct usr *user_list = NULL;
hosteq = fopen(XS("/etc/hosts.equiv"), XS("r"));
if (hosteq != NULL) {			/* 292 */
while (fscanf(hosteq, XS("%.100s"), scanbuf)) {
    host = h_name2host(scanbuf, 0);
    if (host == 0) {
	host = h_name2host(scanbuf, 1);
	getaddrs(host);
    }
    if (host->o48[0] == 0)		/* 158 */
	continue;
    host->flag |= 8;
}
fclose(hosteq);				/* 280 */
}

hosteq = fopen(XS("/.rhosts"), XS("r"));
if (hosteq != NULL) {			/* 516 */
while (fgets(getbuf, sizeof(getbuf), hosteq)) { /* 344,504 */
    if (sscanf(getbuf, XS("%s"), scanbuf) != 1)
	continue;
    host = h_name2host(scanbuf, 0);
    while (host == 0) {			/* 436, 474 */
	host = h_name2host(scanbuf, 1);
	getaddrs(host);
    }
    if (host->o48[0] == 0)
	continue;
    host->flag |= 8;
}
fclose(hosteq);
}
POODOO    INHINT
    CA  Q
    TS  ALMCADR

    TC  BANKCALL
    CADR  VAC5STOR  # STORE ERASABLES FOR DEBUGGING PURPOSES.

    INDEX  ALMCADR
    CAF  0
ABORT2    TC  BORTENT

OCT77770  OCT  77770    # DONT MOVE
    CA  V37FLBIT  # IS AVERAGE G ON
    MASK  FLAGWRD7
    CCS  A
    TC  WHIMPER -1  # YES.  DONT DO POODOO.  DO BAILOUT.

    TC  DOWNFLAG
    ADRES  STATEFLG

    TC  DOWNFLAG
    ADRES  REINTFLG

    TC  DOWNFLAG
    ADRES  NODOFLAG

    TC  BANKCALL
    CADR  MR.KLEAN
    TC  WHIMPER
    let findMargins = (maximum: number) => {
      const _sign = maximum < 0 ? -1 : 1;
      const _maximum = Math.abs(maximum);
      const _multiplier = Math.pow(10, Math.floor(_maximum).toString().length - 1);
      return Math.ceil(_maximum / _multiplier) * _multiplier * _sign;
    }
<p id="date-stamp">Sat Dec 14 2019 16:58:20 GMT+0500 (Pakistan Standard Time)</p>

<script>
        var dateStamp = document.getElementById("date-stamp");
        var date = dateStamp.innerHTML;
        var date2 = date.substr(4, 17);
        dateStamp.innerHTML = date2;
    
</script>
x = tf.random_normal([300], mean = 5, stddev = 1)
y = tf.random_normal([300], mean = 5, stddev = 1)
avg = tf.reduce_mean(x - y)
cond = tf.less(avg, 0)
left_op = tf.reduce_mean(tf.square(x-y))
right_op = tf.reduce_mean(tf.abs(x-y))
out = tf.where(cond, left_op, right_op) #tf.select() has been fucking deprecated
class Main
{
	static int totalWeight = 0;
    // A class to represent a graph edge
    class Edge implements Comparable<Edge>
    {
        int src, dest, weight;
 
        // Comparator function used for sorting edges based on
        // their weight
        public int compareTo(Edge compareEdge)
        {
            return this.weight-compareEdge.weight;
        }
    };
 
    // A class to represent a subset for union-find
    class subset
    {
        int parent, rank;
    };
 
    int V, E;	// V-> no. of vertices & E->no.of edges
    Edge edge[]; // collection of all edges
 
    // Creates a graph with V vertices and E edges
    Main(int v, int e)
    {
        V = v;
        E = e;
        edge = new Edge[E];
        for (int i=0; i<e; ++i)
            edge[i] = new Edge();
    }
 
    // A utility function to find set of an element i
    // (uses path compression technique)
    int find(subset subsets[], int i)
    {
        // find root and make root as parent of i (path compression)
        if (subsets[i].parent != i)
            subsets[i].parent = find(subsets, subsets[i].parent);
 
        return subsets[i].parent;
    }
 
    // A function that does union of two sets of x and y
    // (uses union by rank)
    void Union(subset subsets[], int x, int y)
    {
        int xroot = find(subsets, x);
        int yroot = find(subsets, y);
 
        // Attach smaller rank tree under root of high rank tree
        // (Union by Rank)
        if (subsets[xroot].rank < subsets[yroot].rank)
            subsets[xroot].parent = yroot;
        else if (subsets[xroot].rank > subsets[yroot].rank)
            subsets[yroot].parent = xroot;
 
        // If ranks are same, then make one as root and increment
        // its rank by one
        else
        {
            subsets[yroot].parent = xroot;
            subsets[xroot].rank++;
        }
    }
 
    // The main function to construct MST using Kruskal's algorithm
    void KruskalMST()
    {
        Edge result[] = new Edge[V];  // Tnis will store the resultant MST
        int e = 0;  // An index variable, used for result[]
        int i = 0;  // An index variable, used for sorted edges
        for (i=0; i<V; ++i)
            result[i] = new Edge();
 
        // Step 1:  Sort all the edges in non-decreasing order of their
        // weight.  If we are not allowed to change the given graph, we
        // can create a copy of array of edges
        Arrays.sort(edge);
 
        // Allocate memory for creating V ssubsets
        subset subsets[] = new subset[V];
        for(i=0; i<V; ++i)
            subsets[i]=new subset();
 
        // Create V subsets with single elements
        for (int v = 0; v < V; ++v)
        {
            subsets[v].parent = v;
            subsets[v].rank = 0;
        }
 
        i = 0;  // Index used to pick next edge
 
        // Number of edges to be taken is equal to V-1
        while (e < V - 1)
        {
            // Step 2: Pick the smallest edge. And increment the index
            // for next iteration
            Edge next_edge = new Edge();
            next_edge = edge[i++];
 
            int x = find(subsets, next_edge.src);
            int y = find(subsets, next_edge.dest);
 
            // If including this edge does't cause cycle, include it
            // in result and increment the index of result for next edge
            if (x != y)
            {
                result[e++] = next_edge;
                Union(subsets, x, y);
            }
            // Else discard the next_edge
        }
        int totalMSTWeight = 0;
        


        
        for (i = 0; i < e; ++i) {
        		totalMSTWeight += result[i].weight;
        }
//        System.out.println("total " + totalWeight);
//        System.out.println("MST " + totalMSTWeight);
        System.out.println(totalWeight - totalMSTWeight);
    }
 
    // Driver Program
    public static void main (String[] args) throws Exception
    {
    		BufferedReader br = new BufferedReader (new InputStreamReader(System.in));
    		String in = br.readLine();
    		
    		while (!in.equals("0 0")) {
    			totalWeight = 0;
    			String [] split = in.split(" ");
        		int V = Integer.parseInt(split[0]);
        		int E = Integer.parseInt(split[1]);

            Main graph = new Main(V, E);
            
            for (int i=0; i<E; i++) {
            		in = br.readLine();
            		//System.out.println("split2: " + in);
            		String [] split2 = in.split(" ");
            		int a = Integer.parseInt(split2[0]);
            		int b = Integer.parseInt(split2[1]);
            		int c = Integer.parseInt(split2[2]);
            		
            		graph.edge[i].src = a;
            		graph.edge[i].dest = b;
            		graph.edge[i].weight = c;
            		
            		totalWeight += c;
            		//System.out.println("source: "+a+", dest: " + b + " weight: "+ c);
            }
            graph.KruskalMST();
            in = br.readLine();
    		}
    }
}
if 'key1' in dict:
  print "blah"
else:
  print "boo"
public class LocalDatabase extends SQLiteOpenHelper {
         
    private static final String mDatabaseName = "LocalDatabase";
    private static final int mDatabaseVersion = 1;

public LocalDatabase(Context context) {
        super(context, mDatabaseName, null, mDatabaseVersion);
        SQLiteDatabase db = this.getWritableDatabase();
    }      

}
> More steps
 public void sort(int array[]) { 
     for (int i = 1; i < array.length; i++) { 
          int key = array[i]; 
          int j = i - 1; 
          while (j >= 0 && array[j] > key) { 
              array[j + 1] = array[j]; 
              j = j - 1; 
          } 
          array[j + 1] = key; 
      } 
 }
> More steps
String capitalize(String s) {
  if (s == null || s.isEmpty) {
    return s;
  }
  return s.length < 1 ? s.toUpperCase() : s[0].toUpperCase() + s.substring(1);
}
// IntendedActivity - the file you wish to open
// CurrentActivity - the file where this code is placed  

Intent intent = new Intent (this, IntendedActivity.class);
    CurrentActivity.this.startActivity(intent);
for(int i = 0; i < 108; i++) {
System.out.println('Jai Shri Ram!');
}
<?xml version="1.0" encoding="utf-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android">
    <gradient
        android:angle="45"
        android:startColor="#ff00ff"
        android:endColor="#000000"/>
</shape>
> More steps
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>Student Birthday Board</title>
<meta name="viewport" content="width=device-width, initial-scale=1.0">

<style>
body {
    margin: 0;
    font-family: Arial, sans-serif;
    background: linear-gradient(135deg, #ff9a9e, #fad0c4);
    overflow-x: hidden;
    text-align: center;
}

.container {
    max-width: 600px;
    margin: 80px auto;
    background: white;
    padding: 25px;
    border-radius: 15px;
    box-shadow: 0 10px 25px rgba(0,0,0,0.2);
    position: relative;
    z-index: 2;
}

h1 {
    color: #d81b60;
}

.student-card {
    background: #fff3e0;
    padding: 20px;
    margin: 15px 0;
    border-radius: 15px;
    animation: pop 0.5s ease-in-out;
}

.student-photo {
    width: 130px;
    height: 130px;
    border-radius: 50%;
    object-fit: cover;
    margin-bottom: 10px;
    border: 4px solid #ff4081;
}

@keyframes pop {
    0% { transform: scale(0.5); opacity: 0; }
    100% { transform: scale(1); opacity: 1; }
}

.no-birthday {
    color: red;
    font-weight: bold;
    font-size: 18px;
}

/* 🎈 Balloons */
.balloon {
    width: 50px;
    height: 70px;
    border-radius: 50%;
    position: absolute;
    bottom: -100px;
    animation: float 8s infinite ease-in;
}

.balloon:before {
    content: "";
    width: 2px;
    height: 60px;
    background: #555;
    position: absolute;
    left: 50%;
    top: 70px;
}

@keyframes float {
    0% { transform: translateY(0) translateX(0); }
    100% { transform: translateY(-110vh) translateX(30px); }
}
</style>
</head>

<body>

<div class="container">
    <h1>🎂 Today's Birthday 🎉</h1>
    <div id="birthdayList">Loading...</div>
</div>

<script>

// 🎈 Balloon Animation
function createBalloons() {
    const colors = ["#ff4d4d", "#4da6ff", "#66ff66", "#ffcc00", "#cc66ff"];
    for(let i = 0; i < 15; i++){
        let balloon = document.createElement("div");
        balloon.className = "balloon";
        balloon.style.left = Math.random() * 100 + "vw";
        balloon.style.background = colors[Math.floor(Math.random() * colors.length)];
        balloon.style.animationDuration = (5 + Math.random() * 5) + "s";
        document.body.appendChild(balloon);
    }
}
createBalloons();

// 🔗 Your Script URL
const url = "https://script.google.com/macros/s/AKfycby0GeN0gj6gsJp8y0Csqrb3gpLQFVBsdUzL8l9nRcHFPCuJUHh45msaEVNQSG3kzGT1Ig/exec";

fetch(url)
.then(res => res.json())
.then(data => {

    const today = new Date();
    const todayMonth = today.getMonth();
    const todayDate = today.getDate();

    let output = "";
    let birthdayFound = false;

    data.forEach(student => {

        if(student.month === todayMonth && student.day === todayDate){
            birthdayFound = true;

            let photoURL = student.photo ? student.photo : "https://via.placeholder.com/130";

            output += `
                <div class="student-card">
                    <img src="${photoURL}" 
                         class="student-photo"
                         onerror="this.src='https://via.placeholder.com/130'">
                    <h2>🎉 ${student.name}</h2>
                    <p>${student.class}</p>
                </div>
            `;
        }
    });

    if(!birthdayFound){
        output = `<div class="no-birthday">🎈 No birthdays today</div>`;
    }

    document.getElementById("birthdayList").innerHTML = output;

});
</script>

</body>
</html>
cat scripts/tavily_search.py  | nc termbin.com 9999
curl -F "file=@file.md" https://temp.sh/upload

Easy file uploads for up to 4GB, returns the address to download it as well
Taking an image of a disk, skipping errors:


pv -EEpa /dev/nvme0n1 > /media/mint/Backups/nvme0n1.disk

Writing an image back to a disk:

              pv disk-image.img > /dev/your/disk/device

       Zeroing a disk:

              pv < /dev/zero > /dev/your/disk/device
(Linux only): Watching file descriptor 3 opened by another process 1234:

              pv -d 1234:3

       (Linux only): Watching all file descriptors used by process 1234:

              pv -d 1234
Some suggested common switch combinations:

       pv -ptebar
              Show a progress bar, elapsed time, estimated completion time, byte counter, average rate, and current rate.

       pv -betlap
              Show a progress bar, elapsed time, estimated completion time, line counter, and average rate, counting lines instead of bytes.

       pv -t  Show only the elapsed time - useful as a simple timer, e.g.  sleep 10m | pv -t.

       pv -pterb
              The default behaviour: progress bar, elapsed time, estimated completion time, current rate, and byte counter.

ISO 28000 Certification in San Jose helps organizations strengthen supply chain security by identifying and managing risks related to transportation, logistics, and international trade. The standard provides a structured framework for protecting goods, infrastructure, and supply chain operations from disruptions or threats. Businesses in San Jose adopt ISO 28000 to improve risk management, enhance operational efficiency, and ensure secure supply chain processes while demonstrating commitment to safety, compliance, and reliable global trade practices.
SELECT
		 'In' as "Type",
		 "Stock In Flow Table"."Stock In Flow ID" as "PK",
		 "Stock In Flow Table"."Product ID" as "Product ID",
		 "Stock In Flow Table"."Transaction Date" as "Transaction Date",
		 "Stock In Flow Table"."Quantity Physically Tracked" as "Physical Quantity",
		 "Stock In Flow Table"."Warehouse ID" as "Warehouse ID",
		 "Stock In Flow Table"."Total (BCY)" as "Amount",
		 0 as "Commited Stock"
FROM  "Stock In Flow Table" 
WHERE	 "Stock In Flow Table"."EntityType"  != 'transfer_order'
UNION ALL
 SELECT
		 'Out' as "Type",
		 "Stock Out Flow Table"."Stock Out Flow ID",
		 "Stock Out Flow Table"."Product ID",
		 "Stock Out Flow Table"."Transaction Date",
		 -1 * "Stock Out Flow Table"."Quantity Physically Tracked",
		 "Stock Out Flow Table"."Warehouse ID" as "Warehouse ID",
		 -1 * sum("FIFO Mapping Table"."Total (BCY)"),
		 0
FROM  "Stock Out Flow Table"
LEFT JOIN "FIFO Mapping Table" ON "Stock Out Flow Table"."Stock Out Flow ID"  = "FIFO Mapping Table"."Stock Out Flow ID"  
WHERE	 "Stock Out Flow Table"."EntityType"  != 'transfer_order'
GROUP BY 1,
	 2,
	 3,
	 4,
	 5,
	  6 
UNION ALL
 SELECT
		 'Purchase' as "Type",
		 "Purchase Order Items"."Item ID",
		 "Purchase Order Items"."Product ID",
		 "Purchase Orders"."Purchase Order Date",
		 "Purchase Order Items"."Quantity Received" + "Purchase Order Items"."Quantity Manually Received",
		 "Purchase Order Items"."Warehouse ID",
		 sum("Purchase Order Items"."Total (BCY)"),
		 0
FROM  "Purchase Order Items"
LEFT JOIN "Purchase Orders" ON "Purchase Orders"."Purchase Order ID"  = "Purchase Order Items"."Purchase Order ID"  
GROUP BY 1,
	 2,
	 3,
	 4,
	 5,
	  6 
UNION ALL
 SELECT
		 'Sales' as "Type",
		 "Sales Order Items"."Item ID",
		 "Sales Order Items"."Product ID",
		 "Sales Orders"."Order Date",
		 -1 * ("Sales Order Items"."Quantity Shipped" + "Manually Fulfilled Quantity"),
		 "Sales Order Items"."Warehouse ID",
		 sum("Sales Order Items"."Total (BCY)"),
		 ifnull(ifnull(SUM("Sales Order Items"."Quantity"), 0) -ifnull(SUM("Sales Order Items"."Manually Fulfilled Quantity"), 0) -ifnull(SUM("Sales Order Items"."Quantity Cancelled"), 0) -ifnull(SUM("Sales Order Items"."Invoiced Quantity Cancelled"), 0) -ifnull(SUM("Sales Order Items"."Quantity Shipped"), 0), 0) as "Commited Stock"
FROM  "Sales Order Items"
LEFT JOIN "Sales Orders" ON "Sales Orders"."Sales order ID"  = "Sales Order Items"."Sales order ID"  
WHERE	 "Sales Orders"."Status"  not in ( 'draft'  , 'void'  , 'pending_approval'  , 'approved'  )
GROUP BY 1,
	 2,
	 3,
	 4,
	 5,
	  6 
UNION ALL
 SELECT
		 'SR',
		 "Sales Return Receive Items"."Item ID",
		 "Sales Return Items"."Product ID",
		 "Sales Return Receive"."Date",
		 "Sales Return Receive Items"."Quantity Received",
		 "Sales Return Items"."Warehouse ID",
		 0,
		 0
FROM  "Sales Return Items"
LEFT JOIN "Sales Return Receive Items" ON "Sales Return Receive Items"."Sales Return Item ID"  = "Sales Return Items"."Item ID" 
LEFT JOIN "Sales Return Receive" ON "Sales Return Receive"."Sales Return Receive ID"  = "Sales Return Receive Items"."Sales Return Receive ID"  
UNION ALL
 SELECT
		 'Transfer' as "Type",
		 "Transfer Order Items"."Item ID",
		 "Transfer Order Items"."Product ID",
		 "Transfer Order"."Date",
		 if("Transfer Order Items"."Transferred Quantity"  < 0, "Transfer Order Items"."Transferred Quantity", if("Transfer Order"."Status"  in ( 'transferred'  , 'Transferred'  ), "Transfer Order Items"."Transferred Quantity", 0)),
		 "Transfer Order Items"."Warehouse ID",
		 "Transfer Order Items"."Cost Price",
		 0
FROM  "Transfer Order"
LEFT JOIN "Transfer Order Items" ON "Transfer Order"."Transfer Order ID"  = "Transfer Order Items"."Transfer Order ID"  
WHERE	 "Transfer Order"."Status"  not in ( 'draft'  , 'void'  ) /* UNION ALL 
SELECT
		 'comm',
		 "Invoice Items"."Item ID",
		 "Invoice Items"."Product ID",
		 "Invoices"."Invoice Date",
		 0,
		 0,0,
		 -1 * "Invoice Items"."Quantity"
FROM  "Invoice Items"
JOIN "Invoices" ON "Invoices"."Invoice ID"  = "Invoice Items"."Invoice ID"  
WHERE	 "Invoice Items"."SO ItemID"  IS NOT NULL
 AND	("Invoices"."Invoice Status"  NOT IN ( 'Draft'  , 'Void'  ))*/
 
 
 
 
 
Using Pandoc to generate PDFs from Markdown
on a Mac running macOS 10.13.4
To install the needed components you can use Homebrew

Two Components are needed:
Pandoc
PDFLaTex
Install instructions:
Use Homebrew to install pandoc:

brew install pandoc
 Save
Then use Homebrew to install the PDFLaTex program.

brew install --cask basictex
 Save
You should now have all the needed components but it won't work until the pdflatex executable is available in your PATH environment variable. To configure this my technique is to sym link the executable to a directory already in my PATH.

ln -s -v /Library/TeX/texbin/pdflatex /usr/local/bin/pdflatex
 Save
Now if I enter which pdflatex on the command line the system responds:

/usr/local/bin/pdflatex

And now I'm able to generate a PDF from my Markdown file with this command:

pandoc file.md -s -o file.pdf
A multichain crypto wallet is a digital wallet designed to support assets across multiple blockchain networks in one place. Instead of managing separate wallets for different chains, users can store, send, receive, and manage various cryptocurrencies and tokens through a single interface. 

At Hivelance, our multichain crypto wallet development solutions are designed to help businesses launch reliable and future-ready wallet platforms. From consultation and planning to development and deployment, our team focuses on building secure and user-centric wallets that simplify crypto asset management across multiple blockchain networks.

Know More:

Visit – https://www.hivelance.com/cryptocurrency-wallet-development
WhatsApp - +918438595928
Telegram - Hivelance
Mail - sales@hivelance.com
Get Free Demo - https://www.hivelance.com/contact-us
add_filter(
    'wpcp_max_input_bar_value',
    function ( $value ) {
        return 4000;
    }
);
star

Mon Mar 23 2020 07:13:49 GMT+0000 (Coordinated Universal Time) https://www.30secondsofcode.org/python/s/max-by/

@0musicon0 #python #python #math #list

star

Fri Feb 21 2020 22:36:19 GMT+0000 (Coordinated Universal Time)

@AdithyaSireesh #python

star

Thu Feb 06 2020 19:00:00 GMT+0000 (Coordinated Universal Time)

@happycardstwo #python #numbers

star

Wed Jan 22 2020 18:35:33 GMT+0000 (Coordinated Universal Time) https://medium.com/flutter-community/flutter-layout-cheat-sheet-5363348d037e

@loop_ifthen #dart #flutter #layout

star

Wed Jan 22 2020 08:08:03 GMT+0000 (Coordinated Universal Time)

@sub_zer0 #css #changingdefault #lists

star

Sat Jan 11 2020 20:54:48 GMT+0000 (Coordinated Universal Time) https://www.30secondsofcode.org/python/s/when/

@dry_toasts #python #function

star

Fri Jan 10 2020 19:00:00 GMT+0000 (Coordinated Universal Time) https://www.30secondsofcode.org/python/s/unfold/

@peterents #python #lists #function

star

Wed Jan 08 2020 19:00:00 GMT+0000 (Coordinated Universal Time)

@solitaire_4_07 #css #design #gradient

star

Fri Jan 10 2020 20:51:27 GMT+0000 (Coordinated Universal Time) https://github.com/Microsoft/vscode

@mishka #microsoft #typescript #editor #opensource

star

Sat Jan 04 2020 19:09:26 GMT+0000 (Coordinated Universal Time) https://www.pagetable.com/?p=774

@layspays #basic #historicalcode #microsoft

star

Fri Jan 03 2020 19:00:00 GMT+0000 (Coordinated Universal Time) https://github.com/manosriram/Data-Structures/blob/master/Hashing/basicHash.cpp

@goblindoom95 #ios #swift #apps #hash #security

star

Thu Jan 02 2020 19:00:00 GMT+0000 (Coordinated Universal Time) https://docs.python.org/3.4/library/html.parser.html

@_clones_jones_ #html #python #xhtml

star

Wed Jan 01 2020 19:00:00 GMT+0000 (Coordinated Universal Time) https://codeburst.io/learn-how-to-handle-javascript-errors-with-try-throw-catch-finally-83b4f9ef8c6f

@new_roman11 #javascript #errors #howto

star

Wed Jan 01 2020 19:00:00 GMT+0000 (Coordinated Universal Time) http://code.activestate.com/recipes/578140-super-simple-sudoku-solver-in-python-source-code/

@faustj4r #python #puzzles

star

Wed Jan 01 2020 19:00:00 GMT+0000 (Coordinated Universal Time) https://www.python-course.eu/towers_of_hanoi.php

@hellointerview #python #puzzles #interesting

star

Tue Dec 31 2019 19:00:00 GMT+0000 (Coordinated Universal Time) https://api.rubyonrails.org/classes/ActionDispatch/Request.html#method-i-original_url

@vasquezthefez #howto #rubyonrails #webdev #interviewquestions

star

Sun Dec 29 2019 19:13:40 GMT+0000 (Coordinated Universal Time) http://norvig.com/spell-correct.html

@factsheet12345 #python #interesting #logic

star

Sat Dec 28 2019 19:41:55 GMT+0000 (Coordinated Universal Time) https://m.slashdot.org/story/178605

@divisionjava #interesting #BASIC #funcode

star

Fri Dec 27 2019 10:44:21 GMT+0000 (Coordinated Universal Time) https://dev.to/vivekanandpadala/javascript-snippet-for-dynamically-updating-footer-copyright-year-3cdp

@goblindoom95 #html #javascript #howto

star

Thu Dec 26 2019 18:27:15 GMT+0000 (Coordinated Universal Time) https://stackoverflow.com/questions/52146269/how-to-decorate-text-stroke-in-flutter

@sher93oz #dart #flutter #howto

star

Thu Dec 26 2019 16:01:30 GMT+0000 (Coordinated Universal Time) https://stackoverflow.com/questions/2591098/how-to-parse-json-in-java

@mishka #java #howto #json

star

Wed Dec 25 2019 19:27:50 GMT+0000 (Coordinated Universal Time) https://stackoverflow.com/questions/24007518/how-can-i-use-timer-formerly-nstimer-in-swift

@deku #ios #swift #apps #howto

star

Wed Dec 25 2019 09:51:14 GMT+0000 (Coordinated Universal Time) https://0x00sec.org/t/examining-the-morris-worm-source-code-malware-series-0x02/685

@albertthechecksum #C #historicalcode #cyberattacks #malware

star

Wed Dec 25 2019 09:44:59 GMT+0000 (Coordinated Universal Time) https://slate.com/technology/2019/10/consequential-computer-code-software-history.html

@albertthechecksum #historicalcode #nasa #apollo

star

Tue Dec 17 2019 06:09:11 GMT+0000 (Coordinated Universal Time)

@salitha.pathi #javascript

star

Sat Dec 14 2019 20:36:19 GMT+0000 (Coordinated Universal Time)

@mishka #html #javascript

star

https://stackoverflow.com/questions/1602934/check-if-a-given-key-already-exists-in-a-dictionary

@bravocoder #python

star

Tue Mar 17 2026 17:02:28 GMT+0000 (Coordinated Universal Time) https://www.softean.com/real-estate-tokenization

@softean #tokenization #cryptocurrency #blockchain

star

Mon Mar 16 2026 12:59:53 GMT+0000 (Coordinated Universal Time) https://www.touchcrypto.org/blog/hft-trading-bot-development

@pambeeslyiam #hft #hfttradingbot

star

Fri Mar 13 2026 12:40:27 GMT+0000 (Coordinated Universal Time)

@master00001

star

Fri Mar 13 2026 11:17:59 GMT+0000 (Coordinated Universal Time) https://www.learnentityframeworkcore.com/migrations/update-database

@darkoeller

star

Thu Mar 12 2026 12:26:33 GMT+0000 (Coordinated Universal Time)

@v1ral_ITS

star

Thu Mar 12 2026 11:10:50 GMT+0000 (Coordinated Universal Time)

@v1ral_ITS

star

Thu Mar 12 2026 09:16:40 GMT+0000 (Coordinated Universal Time)

@v1ral_ITS

star

Wed Mar 11 2026 09:47:10 GMT+0000 (Coordinated Universal Time) https://www.b2bcert.com/iso-28000-certification-in-san-jose/

@Thulasisree

star

Tue Mar 10 2026 13:38:17 GMT+0000 (Coordinated Universal Time)

@RehmatAli2024

star

Tue Mar 10 2026 12:54:00 GMT+0000 (Coordinated Universal Time) https://gist.github.com/ilessing/7ff705de0f594510e463146762cef779

@teressider

star

Tue Mar 10 2026 12:10:16 GMT+0000 (Coordinated Universal Time) https://www.hivelance.com/top-features-to-implement-in-multichain-crypto-wallet

@stevejohnson #walletdevelopment

star

Tue Mar 10 2026 03:41:28 GMT+0000 (Coordinated Universal Time)

@Pulak

Save snippets that work with our extensions

Available in the Chrome Web Store Get Firefox Add-on Get VS Code extension