Skip to content

Instantly share code, notes, and snippets.

View rickithadi's full-sized avatar
🔥
Focusing

hadi rickit rickithadi

🔥
Focusing
View GitHub Profile
@tdreyno
tdreyno / airports.json
Created December 13, 2012 18:50
JSON data for airports and their locations
This file has been truncated, but you can view the full file.
[
{
"code": "AAA",
"lat": "-17.3595",
"lon": "-145.494",
"name": "Anaa Airport",
"city": "Anaa",
"state": "Tuamotu-Gambier",
"country": "French Polynesia",
@sphvn
sphvn / traverse.js
Last active October 26, 2023 21:49
Recursively traverse object javascript, recurse json js, loop and get key/value pair for JSON
var traverse = function(o, fn) {
for (var i in o) {
fn.apply(this,[i,o[i]]);
if (o[i] !== null && typeof(o[i])=="object") {
traverse(o[i], fn);
}
}
}
// usage
@rymawby
rymawby / stripe-credit-card-numbers.md
Last active August 13, 2025 14:18
Stripe test credit card numbers for use in development

Test credit card numbers to use when developing with Stripe

4242424242424242 Visa

4012888888881881 Visa

4000056655665556 Visa (debit)

cd /Library/Preferences
sudo rm com.sophos.sav.plist

cd /Library/Application\ Support/Sophos/cloud/Installer.app/Contents/MacOS/tools/
sudo ./InstallationDeployer —force_remove
@mariacheline
mariacheline / sidebar.js
Last active November 26, 2018 06:51
Integrating React Router with AntD
import React from 'react';
import { Link } from 'react-router-dom';
import { Layout, Menu, Icon } from 'antd';
const { SubMenu } = Menu;
const { Header, Content, Footer, Sider } = Layout;
export const Sidebar = () => {
return(
<Sider className="sidebar" width={280} style={{ background: '#fafafa' }}>
@xsot
xsot / instructions.md
Last active March 3, 2024 13:42
sed maze solver

Usage

sed -E -f solver.sed input where input is a file containing the maze.

For best results, resize your terminal to match the height of the maze. To disable animations, delete the lines containing p.

Maze format

The solver assumes the following:

  • The maze only contains the characters # \nSE
  • Every line has the same number of characters
  • There is only one start (S) and end (E)
@golanlevin
golanlevin / sketch.js
Created September 30, 2018 01:43
PoseNet skeletons with ml5.js & p5.js, using a pre-loaded video
// Copyright (c) 2018 ml5
//
// This software is released under the MIT License.
// https://opensource.org/licenses/MIT
/* ===
ml5 Example
PoseNet example using p5.js
=== */
@totechite
totechite / move_semantics1.rs
Last active May 17, 2023 02:33
My Rustlings answers
// move_semantics1.rs
// Make me compile! Scroll down for hints :)
pub fn main() {
let vec0 = Vec::new();
let mut vec1 = fill_vec(vec0);
println!("{} has length {} content `{:?}`", "vec1", vec1.len(), vec1);
@rickithadi
rickithadi / influencer.py
Created April 1, 2019 16:51
simple script to degeneracy
from instapy import InstaPy
from instapy import smart_run
import random
import requests
import json
import schedule
import time
# get a session!
def gen_comment():
@nicksheffield
nicksheffield / timeslots-generator.js
Created February 17, 2020 02:49
Generate an array of time slots from a beginning to an end, skipping forward a certain amount of time each time
import { isBefore, setHours, setMinutes, setSeconds, addMinutes, setMilliseconds } from 'date-fns'
const setTime = (x, h = 0, m = 0, s = 0, ms = 0) => setHours(setMinutes(setSeconds(setMilliseconds(x, ms), s), m), h)
const from = setTime(new Date(), 9)
const to = setTime(new Date(), 17)
const step = (x) => addMinutes(x, 30)
const blocks = []
let cursor = from