Skip to content

Instantly share code, notes, and snippets.

Avatar
🎯
Focusing

KhalO KhanMaytok

🎯
Focusing
View GitHub Profile
View constellations.css
/* CONSTELLATIONS CODED FROM PURE CSS BY GLENTHEMES */
/* DO NOT STEAL */
/* DO NOT COPY */
/* DO NOT REDISTRIBUTE */
/* PLEASE RESPECT CODERS */
.aries-orb-1,.aries-orb-2,.aries-orb-3,.aries-orb-4,.aries-orb-5,.aries-orb-6{position:absolute;bottom:0;width:5px;height:5px;border-radius:100%}.aries-orb-2{bottom:20px;left:20px}.aries-orb-3{bottom:70px;left:43px}.aries-orb-4{bottom:50px;left:130px}.aries-orb-5{bottom:25px;left:150px}.aries-orb-6{bottom:10px;left:155px}.aries-line-1,.aries-line-2,.aries-line-3,.aries-line-4,.aries-line-5{position:absolute;height:1px;transform-origin:0 100%;opacity:.8}.aries-line-1{bottom:1px;left:1px;width:29px;transform:rotate(-44deg)}.aries-line-2{bottom:24px;left:24px;width:55px;transform:rotate(-66deg)}.aries-line-3{bottom:72px;left:45px;width:89px;transform:rotate(13deg)}.aries-line-4{bottom:52px;left:132px;width:32px;transform:rotate(51deg)}.aries-line-5{bottom:25px;left:153px;width:16px;transform:rotate(70deg)}.taurus-orb-1,.taurus-orb-10,.taurus-orb-2,.taurus-orb-3,.tauru
@KhanMaytok
KhanMaytok / postgres.sh
Last active Dec 24, 2019
postgres common operations
View postgres.sh
# Backup and restore database
su - postgres
pg_dump dbname > dbname.bak
dropdb dbname
createdb dbname
psql test < dbname.bak
# Install postgres
View snippets.py
# Select with today date
# timezone.now().today()
today = date.today()
invoice_for_today = Invoice.objects.filter(date__year=today.year, date__month=today.month, date__day=today.day)
View snippets.py
# Select with today date
# timezone.now().today()
today = date.today()
invoice_for_today = Invoice.objects.filter(date__year=today.year, date__month=today.month, date__day=today.day)
@KhanMaytok
KhanMaytok / css-media-queries-cheat-sheet.css
Created Oct 8, 2018 — forked from bartholomej/css-media-queries-cheat-sheet.css
CSS Media Query Cheat Sheet (with Foundation)
View css-media-queries-cheat-sheet.css
/*------------------------------------------
Responsive Grid Media Queries - 1280, 1024, 768, 480
1280-1024 - desktop (default grid)
1024-768 - tablet landscape
768-480 - tablet
480-less - phone landscape & smaller
--------------------------------------------*/
@media all and (min-width: 1024px) and (max-width: 1280px) { }
@media all and (min-width: 768px) and (max-width: 1024px) { }
@KhanMaytok
KhanMaytok / index.android.ios.js
Created Jun 11, 2018 — forked from pradeep1991singh/index.android.ios.js
Example AsyncStorage React Native
View index.android.ios.js
/**
* Example AsyncStorage React Native
* https://github.com/pradeep1991singh
*/
import React, { Component } from 'react';
import {
AppRegistry,
StyleSheet,
Text,
@KhanMaytok
KhanMaytok / parallel_curl.sh
Created Dec 20, 2017 — forked from CMCDragonkai/parallel_curl.sh
Bash: GNU Parallel with Curl
View parallel_curl.sh
# do it once
seq 1 | parallel -n0 "curl -H 'Content-Type: application/json' http://httpbin.org/post -X POST -d '{\"url\":\"http://google.com/\"}'"
# do it twice
seq 2 | parallel -n0 "curl -H 'Content-Type: application/json' http://httpbin.org/post -X POST -d '{\"url\":\"http://google.com/\"}'"
# do it 4 times, but at 2 a time
seq 4 | parallel -n0 -j2 "curl -H 'Content-Type: application/json' http://httpbin.org/post -X POST -d '{\"url\":\"http://google.com/\"}'"
# you can also put all your commands into a file
View bot.js
// Maytok Boot
const BootBot = require('bootbot');
const bot = new BootBot({
accessToken: 'EAAWXYjB4XLcBADPoDZCVfAGyzAGwpvdhLlQNKkfGvtj6C8ez5TPDZAVZAYQwnqZAWw3ZC6pLEoya0kRZA0Q4z6zszq1K0at8mRTZAfNSGF05cLus96yyHKFeesIKmo7tkaknKtUYbEfbGiop68TeQQMBR4sjxeZAZBwdBWLZCQDhJMGPgdbTPkMoeA',
verifyToken: 'perita',
appSecret: '8e9fb9de00925f56778947b8f6ec54d4'
});
@KhanMaytok
KhanMaytok / delete-channel-messages.js
Created Aug 16, 2017 — forked from firatkucuk/delete-slack-messages.js
Deletes slack public/private channel messages.
View delete-channel-messages.js
var https = require('https');
// CONFIGURATION #######################################################################################################
var token = 'SLACK TOKEN';
var channel = 'CHANNEL ID';
var privateChannel = false;
var delay = 300; // delay between delete operations in millisecond
// GLOBALS #############################################################################################################
View highscore.py
import requests
import sqlite3 as lite
import xml.etree.ElementTree as ET
r = requests.get("https://s130-es.ogame.gameforge.com/api/highscore.xml?category=1&type=0")
score = r.content
root = ET.fromstring(score)
all_data = []
timestamp = root.attrib['timestamp']
You can’t perform that action at this time.