Skip to content

Instantly share code, notes, and snippets.

View HelgeSverre's full-sized avatar
🧠
LLMs gonna take our jewrbs.

Helge Sverre HelgeSverre

🧠
LLMs gonna take our jewrbs.
View GitHub Profile
@HelgeSverre
HelgeSverre / gist:33361e8a283624dfbbd6
Created January 12, 2015 14:47
Tetris Powershell Song
powershell [Console]::Beep(658, 125); [Console]::Beep(1320, 500); [Console]::Beep(990, 250); [Console]::Beep(1056, 250); [Console]::Beep(1188, 250); [Console]::Beep(1320, 125); [Console]::Beep(1188, 125); [Console]::Beep(1056, 250); [Console]::Beep(990, 250); [Console]::Beep(880, 500); [Console]::Beep(880, 250); [Console]::Beep(1056, 250); [Console]::Beep(1320, 500); [Console]::Beep(1188, 250); [Console]::Beep(1056, 250); [Console]::Beep(990, 750); [Console]::Beep(1056, 250); [Console]::Beep(1188, 500); [Console]::Beep(1320, 500); [Console]::Beep(1056, 500); [Console]::Beep(880, 500); [Console]::Beep(880, 500); sleep -m 250; [Console]::Beep(1188, 500); [Console]::Beep(1408, 250); [Console]::Beep(1760, 500); [Console]::Beep(1584, 250); [Console]::Beep(1408, 250); [Console]::Beep(1320, 750); [Console]::Beep(1056, 250); [Console]::Beep(1320, 500); [Console]::Beep(1188, 250); [Console]::Beep(1056, 250); [Console]::Beep(990, 500); [Console]::Beep(990, 250); [Console]::Beep(1056, 250); [Console]::Beep(1188, 500); [
@HelgeSverre
HelgeSverre / MY_Loader.php
Created March 27, 2015 08:45
Template loading function for CodeIgniter 3.x
<?php
/**
* Template loading function for CodeIgniter 3.x
* Location: application/core/MY_Loader.php
* Class MY_Loader
*/
class MY_Loader extends CI_Loader
{
@HelgeSverre
HelgeSverre / kikUserEnum.py
Created January 5, 2016 12:03
KIK Username Enumeration Script
#!/usr/bin/env python
# KIK.me Username Enumerator
import os
import sys
import requests
def main():
base_url = "http://kik.me/"
@HelgeSverre
HelgeSverre / example.js
Created July 17, 2016 15:53
FullCalendar remember selected View
// Get defaultView from LocalStorage, fallback on basicWeek if it is not set yet.
var defaultView = (localStorage.getItem("fcDefaultView") !== null ? localStorage.getItem("fcDefaultView") : "basicWeek");
$('#calendar').fullCalendar({
header: {
left: 'prev,next today',
center: 'title',
right: 'month,basicWeek,basicDay'
},
defaultView: defaultView,
viewRender: function (view, element) {
<?php
// imagine $imageIds is a get parameter with a comma seperated string of ID's
// Eample: http://localhost/download-zip?images=1,2,3,4
Route::get("/download-zip", function ($images) {
$imageIds = explode(",", $images);
// This is an eloquent model
<?php
/*
Assuming that all the data is the same "form", we can simply grab the data from the request
and render it as HTML, then convert that HTML doument to a PDF using the DomPDF library.
*/
// Grab the request data
$request = $_POST;
<?php
require_once "./vendor/autoload.php";
$client = new Goutte\Client();
$keywords = "helge sverre";
$crawler = $client->request('GET', 'https://www.google.no/search?q=' . urlencode($keywords));
<?php
$anArray = [
"stuff" => "stuff",
"stuff2" => "stuff",
"stuff3" => "stuff",
"stuff4" => "stuff",
];
@HelgeSverre
HelgeSverre / filter.js
Last active February 14, 2017 08:06
Simple class based jaavascript filtering solution using data attributes
$(".filters .filters__wrapper ul").on("click", "li", function () {
// Set clicked element as active
$(this).siblings().removeClass("active");
$(this).toggleClass("active");
// Get the class to filter by
var filterClass = $(this).data("filter").trim();
// Get the grid this filter applies to (use data-grid="#some-id-here")