Skip to content

Instantly share code, notes, and snippets.

View matinkaboli's full-sized avatar
🌀
Focusing

Matin Kaboli matinkaboli

🌀
Focusing
View GitHub Profile
@amovah
amovah / generator_promise.js
Last active September 2, 2017 19:59
use Generator and Promise to impelement async functions
function* getResponse() {
yield new Promise(resolve => {
request('example.com', res => {
resolve();
});
});
// you can have more functions. It's just a example. just do it
// yield new Promise ....
}
@alikhajeh1
alikhajeh1 / windows-ssh-keys.md
Created November 8, 2017 15:26
Prerequisites for generating SSH keys on Windows

Creating SSH keys on Windows

  1. Download OpenSSH for Windows and install it.
  2. Setup the environment variables needed to run the SSH Agent by opening a command line shell, and running ssh-agent -s. This will output 2 environment variables that you can set by running set SSH_AUTH_SOCK=value_here and set SSH_AGENT_PID=value_here.
  3. In the command line shell, run ssh-agent to start the SSH Agent.
@eduardobc88
eduardobc88 / share_social_button.html
Created February 15, 2016 17:34
Share HTML Button Telegram and WhatsApp
<a href="whatsapp://send?text=https://www.google.com.mx/" data-action="share/whatsapp/share" >Compartir en WhatsApp</a>
<br>
<a class="tgme_action_button" href="tg://msg_url?url=https://www.google.com.mx/">Compartir en Telegram</a>
@smaznet
smaznet / README.md
Last active June 1, 2021 11:04
اجرا کردن چندین تلگرام بر روی ابونتو

کد زیر رو دانلود یا کپی کنید بعدش تو ترمینال chmod +x tltweak.sh ./tltweak.sh

یه شماره وارد کنید مثلا ۲ که اسم تلگرامتون بشه Telegram 2 ایکون تو دسک تاپ ایجاد شد و همچنین تو منو اپ هاتون هم میاد

@ecarter
ecarter / mapOrder.js
Created December 2, 2011 15:40
Order an array of objects based on another array order
/**
* Sort array of objects based on another array
*/
function mapOrder (array, order, key) {
array.sort( function (a, b) {
var A = a[key], B = b[key];
@dcollien
dcollien / ImageTools.es6
Last active April 28, 2023 09:00
Resize Images in the Browser
let hasBlobConstructor = typeof(Blob) !== 'undefined' && (function () {
try {
return Boolean(new Blob());
} catch (e) {
return false;
}
}());
let hasArrayBufferViewSupport = hasBlobConstructor && typeof(Uint8Array) !== 'undefined' && (function () {
try {
@scriptnull
scriptnull / thirugram.js
Last active October 8, 2023 20:02
spam telegram via telegram web
//spam message the chats with thirugram.js
//open up telegram web and go to the chat you want to spam
//open console ( Ctrl + Shift + J )
//execute the code
var message = ""; //spam message
var interval = 1 ; // in seconds
var count = 10 ; //number of times to send
var notifyInterval = 5 ; //notify
var i = 0 ;
var timer = setInterval(function(){
@chrisjlee
chrisjlee / media-queries.scss
Last active January 6, 2024 12:36
All Media Queries breakpoints
@media (min-width:320px) { /* smartphones, portrait iPhone, portrait 480x320 phones (Android) */ }
@media (min-width:480px) { /* smartphones, Android phones, landscape iPhone */ }
@media (min-width:600px) { /* portrait tablets, portrait iPad, e-readers (Nook/Kindle), landscape 800x480 phones (Android) */ }
@media (min-width:801px) { /* tablet, landscape iPad, lo-res laptops ands desktops */ }
@media (min-width:1025px) { /* big landscape tablets, laptops, and desktops */ }
@media (min-width:1281px) { /* hi-res laptops and desktops */ }
@cadebward
cadebward / service.js
Created November 12, 2015 17:35
Remove `__v` and `_id` from MongoDB
import mongoose, {Schema} from 'mongoose'
export const ServiceSchema = new Schema({
displayName: {type: String, required: true, unique: true}
})
ServiceSchema.set('toObject', {
transform: function (doc, ret) {
ret.id = ret._id
delete ret._id
@MicBrain
MicBrain / metatags.html
Last active April 8, 2024 12:53
The list of useful meta tags used in HTML5 documents.
<html>
<head>
<!--Recommended Meta Tags-->
<meta charset="utf-8">
<meta name="language" content="english">
<meta http-equiv="content-type" content="text/html">
<meta name="author" content=”Rafayel Mkrtchyan”>
<meta name="designer" content=”Rafayel Mkrtchyan”>
<meta name="publisher" content=”Rafayel Mkrtchyan”>