Skip to content

Instantly share code, notes, and snippets.

@EdoardoVignati
EdoardoVignati / read.s
Created October 25, 2018 07:24
Read from stdin and print input - AT&T assembly
#################
# How to run #
#################
# $ as --gstabs read.s -o read.o
# $ ld read.o -o read
# $ ./read
################
.text
@carry0987
carry0987 / RPi3-Auto-WiFi.md
Last active May 28, 2024 15:21
Raspberry Pi 3B+ Auto reconnect to wifi when lost connect

Auto reconnect to wifi when lost connection

Before you start, make sure ip command is available on your system. In modern Linux distributions, ip replaces older ifconfig command. If net-tools package (that includes ifconfig) is not installed and you prefer using it, you can install it via sudo apt-get install net-tools.

Create script file

Use touch /home/pi/wifi-reconnect.sh to create a shell script file, with the following content:

#!/bin/bash
@steven2358
steven2358 / ffmpeg.md
Last active June 10, 2024 08:54
FFmpeg cheat sheet
/*
# Clean UI programming in a vacuum
This app was written for Chapter 19 in the 3rd edition of Eloquent
JavaScript—it aims to demonstrate modern UI programming without
depending on a specific framework or library.
Its convention is that components have an interface like this:
```
@olavopeixoto
olavopeixoto / deploy_addon.py
Last active March 24, 2020 21:27
Script to zip Kodi addons
#!/usr/bin/env python
# coding: utf-8
# License: GPL v.3 <http://www.gnu.org/licenses/gpl-3.0.en.html>
"""
Create Kodi addons zip file
"""
from __future__ import print_function
import re
@praeclarum
praeclarum / ObservableQuery.cs
Last active May 7, 2019 19:46
This class is a new collection that is given a function to retrieve its own data. It uses ListDiff to minimize updates.
using System;
using System.Collections.Specialized;
using System.Collections;
using System.Collections.Generic;
using System.Threading;
using System.Linq;
using System.Diagnostics;
using System.Threading.Tasks;
namespace Praeclarum
@jayant91089
jayant91089 / leetcode-bloomberg.md
Last active April 15, 2024 14:25
Answers to leetcode questions tagged 'Bloomberg'

121 Best Time to Buy and Sell Stock

Say you have an array for which the ith element is the price of a given stock on day i.

If you were only permitted to complete at most one transaction (ie, buy one and sell one share of the stock), design an algorithm to find the maximum profit.

Example 1: Input: [7, 1, 5, 3, 6, 4] Output: 5

@vasanthk
vasanthk / System Design.md
Last active June 11, 2024 09:51
System Design Cheatsheet

System Design Cheatsheet

Picking the right architecture = Picking the right battles + Managing trade-offs

Basic Steps

  1. Clarify and agree on the scope of the system
  • User cases (description of sequences of events that, taken together, lead to a system doing something useful)
    • Who is going to use it?
    • How are they going to use it?
@anandology
anandology / email-count.py
Created April 10, 2015 17:44
Script to find the number of emails in the given gmail account
"""Script to count the emails received in a gmail account and posts it to a web hook.
"""
import imaplib
import optparse
import json
import urllib2
def count_emails(username, password, folder="INBOX"):
"""Returns the number of emails in specified folder.
"""
@genadyo
genadyo / gist:295a5e8f0d743f57137f
Created November 27, 2014 17:21
app_store_app_data.json
{
"491289025" : "ijinshan-kappmarket://",
"301521403" : "fb103361823069955://",
"492178411" : "ils492178411://",
"346142396" : "fb234434003713://",
"310633997" : "whatsapp://",
"370614765" : "com.condenet.newyorker://",
"325058491" : "rnmddisco://",
"382952264" : "epichttp://",
"477048487" : "predictwind://",