Skip to content

Instantly share code, notes, and snippets.

View cipto-hd's full-sized avatar
🎯
Focusing

Cipto Hadi cipto-hd

🎯
Focusing
  • Lamongan, Indonesia
View GitHub Profile
@AugustoCalaca
AugustoCalaca / UserAddedSubscription.spec.ts
Last active March 22, 2023 23:43
An example of how to test graphql subscriptions with jest
import { graphql, subscribe, parse } from 'graphql';
import {
connectMongoose,
disconnectMongoose,
clearDbAndRestartCounters,
getContext,
} from '../../../../../test/helpers';
import { schema } from '../../../../schema/schema';
@cipto-hd
cipto-hd / JavascriptCourse@CodeAcademy
Last active August 29, 2015 14:02
Javascript course at Code Academy
/*
Find a name on strings using array, for loops, substr
*/
text = "Blah blah blah blah blah blah Eric \
blah blah blah Eric blah blah Eric blah blah \
blah blah blah blah blah Eric";
var myName = "blah";
var hits = [];
@katowulf
katowulf / no_dup_emails.js
Last active May 17, 2020 10:43
Enforce no duplicate emails in Firebase
/**
* My Firebase data structure:
*
* /email_index/$email/user_id
* /user/$user_id/email
*/
var fb = new Firebase(URL);
function isDuplicateEmail(email, callback) {
@jwebcat
jwebcat / gist:5122366
Last active August 25, 2024 12:59 — forked from lemenkov/gist:1674929
Properly download from github using wget and curl
wget --no-check-certificate --content-disposition https://github.com/joyent/node/tarball/v0.7.1
# --no-check-cerftificate was necessary for me to have wget not puke about https
curl -LJO https://github.com/joyent/node/tarball/v0.7.1
@pitch-gist
pitch-gist / gist:2999707
Created June 26, 2012 22:21
HTML: Simple Maintenance Page
<!doctype html>
<title>Site Maintenance</title>
<style>
body { text-align: center; padding: 150px; }
h1 { font-size: 50px; }
body { font: 20px Helvetica, sans-serif; color: #333; }
article { display: block; text-align: left; width: 650px; margin: 0 auto; }
a { color: #dc8100; text-decoration: none; }
a:hover { color: #333; text-decoration: none; }
</style>
@klmr
klmr / preg_helper.php
Created December 7, 2008 21:36
Function to merge several regular expressions into one single expression.
<?php
/**
* Copyright 2008-2009 Konrad Rudolph
* All rights reserved.
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell