This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import * as React from 'react'; | |
const useIsFirstRender = (): boolean => { | |
const isFirst = React.useRef(true); | |
if (isFirst.current) { | |
isFirst.current = false; | |
return true; | |
} else { |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
git log --author="Linus Torvalds" --date=iso | perl -nalE 'if (/^Date:\s+[\d-]{10}\s(\d{2})/) { say $1+0 }' | sort | uniq -c|perl -MList::Util=max -nalE '$h{$F[1]} = $F[0]; }{ $m = max values %h; foreach (0..23) { $h{$_} = 0 if not exists $h{$_} } foreach (sort {$a <=> $b } keys %h) { say sprintf "%02d - %4d %s", $_, $h{$_}, "*"x ($h{$_} / $m * 50); }' | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <stdio.h> | |
/* | |
* Calculates what Ada Lovelace labeled "B7", which today we would call the 8th | |
* Bernoulli number. | |
*/ | |
int main(int argc, char* argv[]) | |
{ | |
// ------------------------------------------------------------------------ | |
// Data |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Immutable Stack Type using List | |
case class Stack[A] (elems: Seq[A] = List.empty[A]) { | |
def push(v: A) : Stack[A] = Stack(v +: elems) | |
def pushAll(xs: Iterable[A]) : Stack[A] = | |
xs.foldLeft (this) ((accStack, e) => accStack.push(e)) | |
def pop(): Either[String, (A, Stack[A])] = { | |
if (isEmpty) Left("Cannot pop from empty stack") |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Usage: ruby last_game.rb <summoner_name> <na/euw/...> | |
require "net/http" | |
require "json" | |
require "date" | |
# TODO: Insert your own key here! | |
API_KEY = "<YOUR-RIOT-API-KEY-HERE>" | |
@summoner_name = ARGV[0] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def unfoldr[A, B](seed: B)(func: B => Option[(A, B)]): Stream[A] = | |
func(seed) match { | |
case Some((a, b)) => a #:: unfoldr(b)(func) | |
case None => Stream.empty | |
} | |
/* | |
* Infinite sequence: | |
* val s = unfoldr (0) (b => Some(b,b+1)) | |
* Fibonacci sequence: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!doctype html> | |
<html> | |
<head> | |
<meta charset="utf-8"> | |
<title>React Quick Prototyping</title> | |
</head> | |
<body> | |
<div id="root"></div> | |
<script src="https://cdnjs.cloudflare.com/ajax/libs/react/0.14.6/react.min.js"></script> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
################################################################################# | |
# CVE-XXXXX Wordpress and Drupal XML Blowup Attack DoS# | |
# Author: Nir Goldshlager - Salesforce.com Product Security Team# | |
# This is a Proof of Concept Exploit, Please use responsibly.# | |
################################################################################# | |
#!/usr/bin/env python | |
from __future__ import print_function | |
import threading | |
import time | |
import urllib |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package com.deviant.security.shield; | |
public final class BuildConfig { | |
public static final String BUILD_TYPE = "debug"; | |
public static final boolean DEBUG; | |
public static final String FLAVOR = ""; | |
public static final String PACKAGE_NAME = "com.deviant.security.shield"; | |
public static final int VERSION_CODE = 4; | |
public static final String VERSION_NAME = "2.2"; |
NewerOlder