Skip to content

Instantly share code, notes, and snippets.

@nullcookies
nullcookies / httparty.md
Created December 30, 2019 13:47 — forked from pwightman/httparty.md
HTTParty usage

This is a much simpler HTTP library called HTTParty. The standard library that comes with Ruby is quite verbose, you have to convert a string to a URL, specify URLs and ports and all sorts of longwinded stuff. This is much easier. There's both a command line interface, if you just want to test things out for the queue at the command line, for example, as well as a ruby library. I'll show both here. You can install it with gem install httparty.

Command-line usage:

httparty -H Accept:application/json "http://nine.eng.utah.edu/schools"

# Accepts JSON, uses POST instead of GET, and does BASIC authentcation, which the queue requires
# once you've logged in. I can show you that later.
httparty -H Accept:application/json -a post -u username:password "http://nine.eng.utah.edu/schools"
<!DOCTYPE html>
<html lang="en">
<head>
<!-- Required meta tags -->
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
<!-- Bootstrap CSS -->
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/twitter-bootstrap/4.1.0/css/bootstrap.min.css" integrity="sha256-NJWeQ+bs82iAeoT5Ktmqbi3NXwxcHlfaVejzJI2dklU=" crossorigin="anonymous" />
@nullcookies
nullcookies / email_js.rb
Created January 10, 2020 08:56 — forked from sshkarupa/email_js.rb
letters generator for email.js.slim
str = '<a href="mailto:#{ARGV[0]}">#{ARGV[0]}</a>'
# ARGV[0] = 'user@example.com'
# str = '<a href="mailto:user@example">user@example</a>'
original = str.split("")
new_arr = []
original.each_index {|i| new_mas << { i => original[i] } }
@nullcookies
nullcookies / email.js.slim
Created January 10, 2020 08:56 — forked from sshkarupa/email.js.slim
coding email address through js
.email
|По всем вопросам обращайтесь на&nbsp;
javascript:
var aixccwp = ["l", "@", "m", "g", "a", "p", "=", "@", "<", "h", "<", "s", "g", "a", "p", "\"", "l", "h", "e", "s", "k", "m", "i", "i", "i", "m", "k", ">", "r", "r", "\"", "s", "a", ".", " ", "o", "a", "o", "r", "a", "a", "t", ":", "s", "a", "o", "u", "m", "c", "m", ">", "a", "a", ".", ".", ".", "f", "h", "/", "u", "c", "l"];
var fsklvjp = [31, 26, 57, 49, 47, 24, 7, 48, 58, 41, 0, 40, 27, 1, 46, 8, 53, 19, 5, 38, 42, 9, 30, 11, 52, 50, 20, 61, 44, 4, 36, 16, 10, 32, 2, 34, 60, 14, 22, 43, 51, 13, 15, 18, 25, 56, 23, 35, 33, 28, 37, 29, 21, 39, 54, 17, 6, 3, 59, 45, 55, 12];
var lqnbuaw = new Array();
for(var i=0; i<fsklvjp.length; i++){ lqnbuaw[fsklvjp[i]] = aixccwp[i]; }
for(var i=0; i<lqnbuaw.length; i++){ document.write(lqnbuaw[i]); }
noscript Please enable Javascript to see the email address
# Boxstarter Script (Windows 10 settings and modern web deployment)
# Credit to github.com/elithrar
# Pre
Disable-UAC
# Set PC name
$computername = "JASM-PC"
if ($env:computername -ne $computername) {
Rename-Computer -NewName $computername
@nullcookies
nullcookies / xywaceruzaluf.md
Created January 14, 2020 11:27 — forked from anonymous/xywaceruzaluf.md
drupal создание шаблона с нуля

10 ноября состоялся очередной вебинар из серии "Друпал для всех", на этот. процесса создания темы для Drupal'а на основе сверстанного шаблона.. Курс "Создание сайтов с нуля при помощи системы управления Drupal". Стоит ли использовать готовые темы WordPress при создании сайта. тему с нуля; Создать тему на основе стартового шаблона _S.. Создать сайт на WordPress Создать сайт на Joomla Создать сайт на Drupal. Создание шаблонов, модулей и темизация Drupal.. всё с нуля) была создана вторая ветка этого великолепного модуля - Cache Expiration 7.x-2.x. 25 min. ... основу для своих дальнейших работ либо создать с нуля свою собственную.. Основная подсказка по созданию своей те

@nullcookies
nullcookies / bootstrap_pagination_helper.rb
Created January 18, 2020 21:39 — forked from artanikin/bootstrap_pagination_helper.rb
Will_paginate bootstrap 4 renderer
module BootstrapPaginationHelper
class LinkRenderer < WillPaginate::ActionView::LinkRenderer
protected
def page_number(page)
if page == current_page
link(page, "#", :class => 'active')
else
link(page, page, :rel => rel_value(page))
end
@nullcookies
nullcookies / sceneBug.js
Created February 7, 2020 11:19 — forked from RealPeha/sceneBug.js
Telegraf bug
const Telegraf = require('telegraf')
const session = require('telegraf/session')
const Stage = require('telegraf/stage')
const Scene = require('telegraf/scenes/base')
const mongoose = require('mongoose')
require('dotenv').config()
const scheme = new mongoose.Schema({
key: String,
session: {},
@nullcookies
nullcookies / getWorkingDays.php
Created June 30, 2020 21:58 — forked from quawn/getWorkingDays.php
PHP: GetWorkingDays excluding weekend and holidays
<?php
function getWorkingDays($startDate,$endDate,$holidays) {
// do strtotime calculations just once
$endDate = strtotime($endDate);
$startDate = strtotime($startDate);
//The total number of days between the two dates. We compute the no. of seconds and divide it to 60*60*24
//We add one to inlude both dates in the interval.
$days = ($endDate - $startDate) / 86400 + 1;