Skip to content

Instantly share code, notes, and snippets.

View panoply's full-sized avatar
🥛
Rich in the hood

ΝΙΚΟΛΑΣ panoply

🥛
Rich in the hood
View GitHub Profile
@panoply
panoply / shopify-sidebar-filter.js
Created May 21, 2016 15:55
Sidebar Filter using Liquid for BRIXTOL.
<ul>
{% for tag in collection.tags %}
{% if
tag != 'Bomber'
and tag != 'Autumn / Winter'
and tag != 'Spring / Summer'
and tag != 'Coat'
and tag != 'Duffel'
@panoply
panoply / temp.json
Last active May 26, 2016 18:54
Json File Example for Stack
{ "products":[
{
"title":"One",
"handle":"link-one",
"tags":[
"Red",
"Square",
"Autumn \/ Winter"
],
"variants":[
@panoply
panoply / .htacess-git-ingored
Created May 30, 2016 01:34
Ignore .git from .htaccess
<Files .git/*>
order allow,deny
deny from all
</Files>
@panoply
panoply / add-free-product.liquid
Created June 3, 2016 21:52
Shopify Scripts – Free product with purchase of Item. Also requires a Liquid integration.
//
{% assign found = false %}
{% for finder in product.collections %}
{% if finder.handle == 'name' %}
{% assign found = true %}
{% endif %}
{% endfor %}
{% if found == false %}
<ul>
@panoply
panoply / Preferences.sublime-settings.js
Created June 28, 2016 21:57
Sublime 3 settings as of 2016 and using dark code backdrop.
{
"binary_file_patterns":
[
"generated/*",
"*.tbz2",
"*.gzip",
"*.jpg",
"*.jpeg",
"*.png",
"*.gif",
@panoply
panoply / Readme.md
Created July 26, 2016 08:43
Silk Stock POST request (EXAMPLE) using Guzzle 6.0 >

Setup

Dependency Inversion principle design pattern (which is where you find SILK API connection). Here is an example of how I am talking to the SILK API. The GET request as of 2 days ago is now returning an empty page, this also tested using POSTMAN. POST requests using Guzzle continually fail, have never worked.

Build with Laravel 5.2 framework.

.ENV Values (Secret is valid):

@panoply
panoply / unfollow.js
Created September 6, 2016 20:10
Unfollow all on Instagram
setInterval(Unfollow, 1000);
function Unfollow() {
var followingBox = document.querySelectorAll("a[href='/brixtol/following/']");
followingBox[0].click();
setTimeout(function(){
var following = document.querySelectorAll("._aj7mu._r4e4p._95tat._o0442");
for (var i = 0; i < following.length; i++){
following[i].click();
}
var close = document.querySelectorAll("._3eajp");
@panoply
panoply / geoip.js
Created September 9, 2016 14:05
GeoIP Redirect using javascript
<script>
function geo(a) {
switch (a.country.code)
{
case "SE": // Redirect is visitor from Sweden
case "NO": // Redirect is visitor from Norway
case "DK": // Redirect is visitor from Denmark
window.location = "https://se.brixtol.com" + window.location.pathname; // edit for your URL
break;
default:
@panoply
panoply / Drawers.html
Created September 21, 2016 16:48
Offcanvas Drawer (Standalone)
<div id="LeftDrawer" class="drawer drawer--left">
<div class="drawer__header">
<div class="drawer__title">Title</div>
</div>
<div class="drawer__navigation">
<ul>
<li><a href="#">Example Link</a></li>
<li><a href="#">Example Link</a></li>
<li><a href="#">Example Link</a></li>
<li><a href="#">Example Link</a></li>
@panoply
panoply / Seasons.js
Created October 11, 2016 16:34
GET current season
Date.fromJulian = function (j) {
j = (+j) + (30.0 / (24 * 60 * 60));
var A = Date.julianArray(j, true);
return new Date(Date.UTC.apply(Date, A));
};
Date.julianArray = function (j, n) {
var F = Math.floor;
var j2, JA, a, b, c, d, e, f, g, h, z;
j += 0.5;
j2 = (j - F(j)) * 86400.0;