Skip to content

Instantly share code, notes, and snippets.

Xaekai Xaekai

Block or report user

Report or block Xaekai

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@victornpb
victornpb / deleteDiscordMessages.js
Last active Nov 17, 2019
Delete all your messages from DM or Channel in Discord
View deleteDiscordMessages.js
/*
This file is now hosted here:
https://github.com/victornpb/deleteDiscordMessages
*/
@calzoneman
calzoneman / termimg.c
Created Jan 13, 2018
Display images (in true color!) in a compatible terminal emulator using block characters
View termimg.c
#include <gd.h>
#include <stdio.h>
#include <string.h>
void process(gdImagePtr img) {
for (int j = 0; j < img->sy/2; j++) {
for (int i = 0; i < img->sx; i++) {
int top = gdImageGetPixel(img, i, j*2 );
int bottom = gdImageGetPixel(img, i, j*2 + 1);
@jkjustjoshing
jkjustjoshing / $inject.user.js
Last active Mar 16, 2017
Angular $inject userscript.
View $inject.user.js
// ==UserScript==
// @name AngularJS Injector
// @namespace http://joshkra.me/
// @version 0.1
// @description Binds $inject method to window
// @author jkjustjoshing
// @match *://*/*
// ==/UserScript==
// This userscript creates an $inject() method on the window object that can be used to
@PatrickJS
PatrickJS / factory-shared.es5.js
Last active Apr 19, 2018
Different examples of OOP "class" with "inheritance" done using JavaScript including languages that transpile into js. Take notice to the amount of boilerplate that's needed in ES5 compared to ES6. These examples all have the same interface with pros/cons for each pattern. If they seem similar that's whole point especially the difference between…
View factory-shared.es5.js
var EventEmitter = require('events').EventEmitter;
var _ = require('lodash');
// Factory shared
var makePerson = function() {
var person = {};
EventEmitter.call(person);
person.wallet = 0;
_.extend(person, personMethods)
return person;
@benfoxall
benfoxall / MutationObserverLogger.js
Created Dec 5, 2012 — forked from pgchamberlin/MutationObserverLogger.js
Snippet that logs DOM mutations using the MutationObserver API
View MutationObserverLogger.js
<script type="text/javascript">
// See MDN: https://developer.mozilla.org/en-US/docs/DOM/MutationObserver?redirectlocale=en-US&redirectslug=DOM%2FDOM_Mutation_Observers
(function(){
// select the target node
var target = document.querySelector('body');
var MutationObserver = window.MutationObserver || window.WebKitMutationObserver || window.MozMutationObserver;
var i={};
// create an observer instance
var observer = new MutationObserver(function(mutations) {
@CatTail
CatTail / htmlentity.js
Created Nov 30, 2012
Javascript: encode(decode) html text into html entity
View htmlentity.js
// encode(decode) html text into html entity
var decodeHtmlEntity = function(str) {
return str.replace(/&#(\d+);/g, function(match, dec) {
return String.fromCharCode(dec);
});
};
var encodeHtmlEntity = function(str) {
var buf = [];
for (var i=str.length-1;i>=0;i--) {
@michiel
michiel / cors-nginx.conf
Created Jul 5, 2011
Wide-open CORS config for nginx
View cors-nginx.conf
#
# Wide-open CORS config for nginx
#
location / {
if ($request_method = 'OPTIONS') {
add_header 'Access-Control-Allow-Origin' '*';
#
You can’t perform that action at this time.